﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MyFitness.Model;

namespace MyFitness.View
{
    public partial class ReportsForm : Form
    {
        #region Declared Variables
        private Trainee trainee;
        private MyFitnessDatabaseEntities database;
        #endregion

        public ReportsForm(MyFitnessDatabaseEntities db, string trainee_email)
        {
            InitializeComponent();

            try
            {
                // Ensures a valid trainee was passed into the function otherwise the form will exit.
                if (trainee_email.Length > 0 || db == null)
                {
                    database = db;
                    trainee = (Trainee)database.Users.Find(trainee_email);

                    InitializeComponent();
                    CenterToParent();
                }
                else
                    Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
}
